// Learn TypeScript:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

import BannerAd from "./Zsrc/BannerAd";

const { ccclass, property } = cc._decorator;

@ccclass
export default class AudioManager extends cc.Component {

    public static get Instance(): AudioManager {
        return this.instance;
    }

    private static instance: AudioManager;


    @property(cc.AudioClip)
    audio: cc.AudioClip = null;

    // LIFE-CYCLE CALLBACKS:

    onLoad() {
        AudioManager.instance = this;
    }

    start() {
    }

    // update (dt) {}

    ButtonAudio() {
        cc.audioEngine.playEffect(this.audio, false);
        if (BannerAd.Instance.cityIswhite) BannerAd.Instance.ShowCustomAd();
    }
}
